#include "game_conf.h"
#include <fstream>

using namespace std;

bool GameConfig::InitConfig(const std::string & conf_file)
{
	std::ifstream in(conf_file.c_str(), std::ifstream::binary);
	if (!in) {
		std::cout << "init file no found." << endl;
		return false;
	}

	Json::Reader reader;
	bool ret = reader.parse(in, *this);
	if (!ret) {
		in.close();
		std::cout << "init file parser." << endl;
		return false;
	}

	in.close();
	return true;
}
